#-------------------------------------------------------------------------------
# @file 	CMakeLists
# @author 	mojinpan
# @copyright (c) 2018-2024 mojinpan. All rights reserved.
# @brief 	tbox静态编译脚本
# @version 	V0.1
# @date 	2025-04-27
#
# @brief 	功能说明
# @details
# 1.自动添加头文件给主cmake
# 2.自动将库名称信息添加到 STATIC_LIB_LIST 变量回传给主cmake
# 3.自动将库路径信息添加到 LIB_LINK_DIR 变量回传给主cmake
# 4.自动将头文件路径信息添加到 INCLUDE_DIR 变量回传给主cmake
#
# @version 	V0.1
# @date 	2024-04-27
# @details
# 1.实现第三方库的引用
# 2.实现按文件夹命名库名称
# 3.实现头文件和库名称共享给主cmake
#-------------------------------------------------------------------------------

# 将静态库添加到静态库列表(该列表由主CMake提供)
if(DEFINED STATIC_LIB_LIST)
  set(STATIC_LIB_LIST 
  ${STATIC_LIB_LIST} 
  tbox_main
  tbox_coroutine
  tbox_alarm
  tbox_trace
  tbox_terminal
  tbox_network
  tbox_flow
  tbox_http
  tbox_jsonrpc
  tbox_crypto
  tbox_dbus
  tbox_eventx
  tbox_event
  tbox_log
  tbox_util
  tbox_base
  PARENT_SCOPE
)
else()
  message(FATAL_ERROR "The variable STATIC_LIB_LIST is not defined!")
endif()

#添加库的链接路径(该列表由主CMake提供)
if(DEFINED LIB_LINK_DIR_LIST)
  set(LIB_LINK_DIR_LIST ${LIB_LINK_DIR_LIST} ${CMAKE_CURRENT_SOURCE_DIR}/arm PARENT_SCOPE)
else()
  message(FATAL_ERROR "The variable LIB_LINK_DIR_LIST is not defined!")
endif()

# 添加头文件路径(该列表由主CMake提供)
if(DEFINED LIB_INCLUDE_DIR_LIST)
  set(LIB_INCLUDE_DIR_LIST ${LIB_INCLUDE_DIR_LIST} ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
else()
  message(FATAL_ERROR "The variable LIB_INCLUDE_DIR_LIST is not defined!")
endif()

